package com.skeeey.aim.service.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

public interface TempleteDao<T extends Serializable, PK extends Serializable> {
	
	T get(PK id);
	
	T load(PK id) throws DaoException;

	void update(T entity) throws DaoException;
	
	void save(T entity) throws DaoException;
	
	void saveOrUpdate(T entity) throws DaoException;
	
	void saveOrUpdateAll(Collection<T> entities) throws DaoException;

	void delete(T entity) throws DaoException;
	
	void deleteByKey(PK id) throws DaoException;
	
	void deleteAll(Collection<T> entities) throws DaoException;
	
	List<T> list();
	
	List<T> query(final String hql) throws DaoException;
}
